﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NotaCreditoEditForm.aspx.cs" 
Inherits="UILGestion.VentaAdmin.DocumentoVenta.NotaCreditoEditForm" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>

<%@ Register src="DocumentoVentaItemGrid.ascx" tagname="DocumentoVentaItemGrid" tagprefix="uc2" %>

<%@ Register src="../RendicionVenta/PendientePagoPanel.ascx" tagname="PendientePagoPanel" tagprefix="uc3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
    


 <style type="text/css">

table {border-collapse:collapse}
#dispo td{
	border:thin solid #007FFF;
	height: 20px;
	text-align: center;
}
#leyenda td{
	border:thin solid #007FFF;
}

     .style1
     {
         height: 99px;
     }

 </style>
    <title>Registro de Etapa Venta</title>
    
    
    <script src="../../Scripts/jquery-1.5.2.min.js" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function () {
           $(document).bind('contextmenu', function (e) {
               return false;
           });
       });
</script>
   
    <script src="../../Scripts/NotaCredito.js" type="text/javascript"></script>
    <script src="../../Scripts/SearchResult.js" type="text/javascript"></script>
  
   
   
    </head>
<body>
    <form id="form1" runat="server">
    <input id="type" type="hidden" runat="server" />
    <input id="internalID" type="hidden" runat="server" />
    <input id="idEtapa" type="hidden" runat="server" />
    
    <input id="paginaAnt" type="hidden" runat="server" />
    <input id="idProyecto" type="hidden" runat="server" />
    
    <input id="idColeccion" type="hidden" runat="server" />
    <input id="idColeccionRef" type="hidden" runat="server" />
    
    <input id="idMoneda" type="hidden" runat="server" />
    <input id="idColeccionLista" type="hidden" runat="server" />
   
     <uc1:menuCtrl ID="menuCtrl1" runat="server" />
    
     <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" 
      EnableScriptGlobalization="true"  
     EnablePartialRendering="true" />
    
     <asp:Panel ID="pnlMain" runat="server"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
  <asp:Label ID="Label2" runat="server" Text="NOTA DE CREDITO" 
             style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>

          <asp:Panel ID="PanelButtom" runat="server"     class="ms-crm-Form-Body" >                 
   <table >
<tr>

<td>
    <asp:Button ID="saveBTN" runat="server" Text="Guardar"   OnClientClick="return confirm('Usted quiere guardar la Documento Venta?')"   
       OnClick="button"   CssClass="ms-crm-List-Header"    /></td>
<td>
    <asp:Button ID="cancelarBTN" runat="server" Text="Cancelar"  
       OnClick="button" CssClass="ms-crm-List-Header"  /></td>
        <td></td>
        <td>
    <asp:Button ID="refreshBTN" runat="server" Text="Restablecer"   OnClick="button" CssClass="ms-crm-List-Header" 
          /></td> 
 
</tr>
</table>
</asp:Panel>

<asp:Panel ID="PanelBody" runat="server"  BackColor="white" >



                
                <table>
                   
                    <tr>
                        <td rowspan="11" valign="top"  >
               
                                     <table>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                             <td width="280px">
                                                 &nbsp;</td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Num Documento:</td>
                                             <td width="280px">
                                                
                                                 <asp:TextBox ID="serieTXT" runat="server" Text="" Width="50px" ReadOnly="true"></asp:TextBox>
                                                     <asp:TextBox ID="numDocumentoTXT" runat="server" Text="" Width="100px" ></asp:TextBox>
                                                 
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Fecha:</td>
                                             <td width="280px">
                                                 <asp:TextBox ID="fechaTXT" runat="server" Width="70px"></asp:TextBox>
                                                 <asp:ImageButton ID="ImageButton3" runat="Server" 
                                                     AlternateText="Click aqui para mostrar calendario" 
                                                     ImageUrl="~/Images/month.gif" Width="16px" />
                                               <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                     PopupButtonID="ImageButton3" TargetControlID="fechaTXT"></asp:CalendarExtender>
            
                                             </td>
                                         </tr>
                                          <tr>
                                              <td align="right" width="100px">
                                                  Cliente:</td>
                                              <td width="280px">
                                               <lib:Input ID="clienteTXT" runat="server" DataType="List"  backcolor="#DFE8F6"
                                                 method="GetCliente" 
                                                     NumColum="9" onchange="javascript:validarCliente(this);" 
                                                     OnSelect="SelectCliente" Width="250px" TabIndex="2"></lib:Input>
                                                
                                                  <br />
                                                  
                                              </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                             <td width="280px">
                                             
                                                 
                                                 <asp:HyperLink ID="clienteHLK" runat="server" ForeColor="Blue"  
                                                     ToolTip="Ir a datos del  cliente"></asp:HyperLink>
                                                 <lib:Input ID="idClienteTXT" runat="server" BackColor="Transparent" 
                                                     ReadOnly="true" Width="0" />
                                             
                                                 
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Doc. Cliente:
                                             </td>
                                             <td width="280px">
                                                 <lib:Input ID="docClienteTXT" runat="server" BackColor="Transparent" 
                                                     ReadOnly="true" Width="30px" />
                                                 <lib:Input ID="numDocClienteTXT" runat="server" BackColor="Transparent" 
                                                     ReadOnly="true" Width="100px" />
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px" valign="top">
                                                 Direccion:</td>
                                             <td width="280px" rowspan="2" valign="top">
                                                   

                                                 <lib:Input ID="direccionTXT" runat="server" BackColor="Transparent" 
                                                     ReadOnly="true" Width="250px" />
                                                   

                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                         </tr>
                           
                                         <tr>
                                             <td align="right" width="100px" valign="top">
                                                 &nbsp;</td>
                                             <td width="280px" valign="top">
                                             
                                                 &nbsp;</td>
                                         </tr>
                           
                        </table>
               
                        </td>
                    </tr>
                  
               
                    <tr >
                        <td style="text-align: right" valign="top">
                       
                            Orden Venta:</td>
                        <td valign="top">
                           
                            <asp:HyperLink ID="ordenVentaHLK" runat="server" ForeColor="Blue"   ToolTip="Ir a la Orden Venta"></asp:HyperLink>
                        </td>
                        <td rowspan="6" align="right" width="180px" >
                           
                            <asp:UpdatePanel ID="totalUPNL" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                            
                       

                            <table class="PanelTotales">
                                <tr>
                                    <td align="right" width="100px">
                                        Mo. Inafecto</td>
                                    <td align="right" width="120px">
                                        <asp:Label ID="simbol1LBL" runat="server"></asp:Label>
                                        <asp:Label ID="montoInafectoLBL" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        Mo. Afecto</td>
                                    <td align="right" width="120px">
                                        <asp:Label ID="simbol2LBL" runat="server"></asp:Label>
                                        <asp:Label ID="montoAfectoLBL" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        IGV:</td>
                                    <td align="right" valign="100px">
                                        <asp:Label ID="simbol3LBL" runat="server"></asp:Label>
                                        <asp:Label ID="totalIGVLBL" runat="server"></asp:Label>
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        Total:</td>
                                    <td align="right" valign="100px">
                                        <asp:Label ID="simbol4LBL" runat="server"></asp:Label>
                                        <asp:Label ID="totalLabel" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>


                                 </ContentTemplate>
                            </asp:UpdatePanel>
                           
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Unid. Inmobiliaria:</td>
                        <td valign="top">
                            <lib:Input ID="UITXT" runat="server" BackColor="Transparent"   
                                ReadOnly="true" Width="100px" />
                            <lib:Input ID="idOrdenVentaItemTXT" runat="server" BackColor="Transparent"   ReadOnly="true" Width="0" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Emisor:</td>
                        <td valign="top">
                            <asp:Label ID="vendedorLBL" runat="server"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Moneda:</td>
                        <td valign="top">
                            <asp:DropDownList ID="monedaDDL" runat="server" Enabled="false" Width="200px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Motivo:</td>
                        <td valign="top">
                            <asp:DropDownList ID="motivoDDL" runat="server"  Width="200px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr >
                        <td align="right" valign="top" width="130px" class="style1">
                            Comentario:</td>
                        <td class="style1">
                            <asp:TextBox ID="comentarioTXT" runat="server" Height="70px" 
                                TextMode="MultiLine" Width="200px"></asp:TextBox>
                        </td>
                        <td class="style1">
                          
                            </td>
                    </tr>
                </table>
            
 
  
 <asp:TabContainer ID="TabContainer1" runat="server"  ActiveTabIndex="0"  
          Width="100%" ><asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Documento ref." >
          
   <ContentTemplate>
    <asp:GridView 
    ID="itemGridView" runat="server" 
    DataKeyNames="idInternal" 
    ShowFooter="True"
    ShowHeaderWhenEmpty="True" 
    SkinID="GridView" >
    <Columns>
    
    <asp:TemplateField HeaderText="Codigo">
    <FooterTemplate>
            <lib:Input ID="codigoEditTextBox" runat="server" BackColor="Transparent" 
            ReadOnly="true" Width="70px" /></FooterTemplate><ItemTemplate><asp:Label 
            ID="codigoLabel" runat="server" Text='<%# Eval("codigo")%>' Width="70px"></asp:Label></ItemTemplate><HeaderStyle 
            Width="70px" />
    </asp:TemplateField>
    
    <asp:TemplateField HeaderText="Descripcion">
    <FooterTemplate>
            <lib:Input ID="descripcionEditTextBox" runat="server"
            Width="100%"></lib:Input></FooterTemplate>
    <ItemTemplate>
    <asp:Label ID="descripcionLabel" runat="server" Text='<%# Eval("descripcion")%>'></asp:Label>
    </ItemTemplate>
    <ControlStyle Width="450px" />
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Total">
    <FooterTemplate>
        <lib:Input ID="totalTextBox" runat="server" BackColor="Transparent" DataType="Double"  Width="120px"></lib:Input>
    </FooterTemplate>
    <ItemTemplate>
    <asp:Label ID="totalLabel" runat="server" Text='<%# Eval("totalStr")%>' /></ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
     <FooterTemplate>
      <asp:LinkButton ID="btnAdd" runat="server" ForeColor="Blue" Text="Añadir" OnClick="AddItem" > 
       </asp:LinkButton>
        </FooterTemplate>

        <ItemTemplate>
       <asp:ImageButton 
                      ID="lnkRemove" runat="server" BorderColor="Control" 
                      CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                      OnClick="DeleteItem" OnClientClick="return confirm('Usted quiere eliminar?')" />
                      </ItemTemplate>
                      </asp:TemplateField>
                      </Columns>
                      </asp:GridView>
                      </ContentTemplate>
                      </asp:TabPanel>
          
          
          <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Detalle" ><ContentTemplate><uc2:DocumentoVentaItemGrid    ID="DocumentoVentaItemGrid1" runat="server" /></ContentTemplate></asp:TabPanel>
          </asp:TabContainer>
      
      

 
 
   
  </asp:Panel>
   

   
    </form>
          
    </body>
</html>
